package com.molichuxing.services.infrastructure.service;

import com.molichuxing.framework.service.RootService;
import com.molichuxing.services.infrastructure.dto.request.create.IovFenceBindingCreateDto;
import com.molichuxing.services.infrastructure.dto.request.create.IovFenceCreateDto;
import com.molichuxing.services.infrastructure.dto.request.modify.IovFenceBindingModifyDto;
import com.molichuxing.services.infrastructure.dto.request.modify.IovFenceModifyDto;
import com.molichuxing.services.infrastructure.dto.response.IovFenceDto;

import java.util.List;
import java.util.Map;

/**
 * @author zhaopenghui
 * 车联网围栏服务
 * 2019-10-29
 */
public interface IovFenceService extends RootService {


    /**
     * 添加围栏
     *
     * @param iovFenceCreateDto
     * @return
     * @throws Exception
     */
    public Integer addFence(IovFenceCreateDto iovFenceCreateDto) throws Exception;

    /**
     * 修改围栏
     *
     * @param iovFenceModifyDto
     * @return
     * @throws Exception
     */
    public Boolean modifyFence(IovFenceModifyDto iovFenceModifyDto) throws Exception;

    /**
     * 围栏id
     *
     * @param fenceId
     * @return
     * @throws Exception
     */
    public Boolean deleteFence(Integer fenceId) throws Exception;


    /**
     * 围栏绑定
     *
     * @param iovFenceBindingCreateDto
     * @return
     * @throws Exception
     */
    public Boolean addBindingFence(IovFenceBindingCreateDto iovFenceBindingCreateDto) throws Exception;

    /**
     * 解绑围栏
     *
     * @param iovFenceBindingModifyDto
     * @return
     * @throws Exception
     */
    public Boolean modifyBindingFence(IovFenceBindingModifyDto iovFenceBindingModifyDto) throws Exception;

    /**
     * @param fenceId 围栏id
     * @param vin     车架号
     * @return
     */
    public Boolean getInfence(Integer fenceId, String vin);

    /**
     * 解除该车辆绑定的所有围栏
     *
     * @param vin
     * @return
     */
    Boolean deleteAllFence(String vin);

    /**
     * 围栏列表
     *
     * @param fenceIdList
     * @return
     */
    public List<IovFenceDto> getFenceList(List<Integer> fenceIdList);

    /**
     * 查询围栏是否绑定车
     *
     * @param fenceId
     * @return
     */
    public Boolean getBindingVehicleByFenceId(Integer fenceId);

    /**
     * 根据围栏id获取信息
     *
     * @param fenceId
     * @return
     */
    public IovFenceDto getFenceById(Integer fenceId);

    /**
     * 根据vin获取车辆所在的围栏
     *
     * @param vinList
     * @return Map<String   ,   List   <   IovFenceDto>>
     */
    Map<String, List<IovFenceDto>> getFenceByVins(List<String> vinList);

    /**
     * 根据围栏名称模糊搜索围栏信息
     * @param fenceName
     * @return
     */
    List<IovFenceDto> getVagueFenceByName(String fenceName);

    /**
     * 车辆所在围栏
     *
     * @param fenceIdList
     * @param vin
     * @return
     */
    public Integer getInFenceId(List<Integer> fenceIdList, String vin);
}
